{% extends "svn.html" %}

{% block tabs %} {{ show_tabs('svn_config') }} {% endblock %}

{% block clientscript %}
	{{super()}}
	<script>
		function cb_onchange(v){
			var url='?cfg='+v;
			window.location=url;
		}
		function do_save() {
         $.messager.confirm("确认", "确定保存吗?", function (r) {
                if (r) {
					     $('#form_post').submit();
                }
            });
		}
		function do_restart() {
			var url='?restart=1';
			window.location=url;
		}
	</script>
{% endblock %}

{% block work_content %}
	<div id="tt">
		<label for="cfg_name">配置文件:</label>
		<select class="easyui-combobox_" id="cfg_name" name="cfg_name" style="width:200px;" onchange="cb_onchange(this.value)">
			<option value=""><请选择></option>
			{% for k,v in cfg_def_list.items() %}
				<option value="{{k}}" {% if curr_cfg==k %} selected {% endif %}>{{v}}</option>
			{% endfor %}
		</select>
 		<a href="javascript:void(0)" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-save'" onclick="do_save()">保存</a>
 		<a href="javascript:void(0)" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-reload'" onclick="do_restart()">重启SVN服务</a>
	</div>
	<div class="easyui-panel_" toolbar='#tt'>
		<form method="post" id="form_post" name="form_post">
			<textarea id="cfg_content" name="cfg_content" style="height:570px;width:100%">{{cfg_content}}</textarea>
		</form>
	</div>
{% endblock %}